home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cserial / queue.h < prev    next >
C/C++ Source or Header  |  1990-04-04  |  824b  |  37 lines

  1. /*
  2.  *                               QUEUE.H
  3.  *
  4.  *                           Written for the
  5.  *
  6.  *                              Datalight
  7.  *                           Microsoft V 5.x
  8.  *                                TurboC
  9.  *                                  &
  10.  *                               Zortech
  11.  *
  12.  *                             C Compilers
  13.  *
  14.  *            Copyright (c) John Birchfield 1987, 1988, 1989
  15.  */
  16.  
  17. typedef struct {
  18.     int    size,
  19.         head,
  20.         tail,
  21.         avail;
  22.     char *buf;
  23. } QUEUE;
  24.  
  25. # define queue_empty(qp) (qp)->head==(qp)->tail
  26. # define queue_avail(qp) (qp)->avail
  27.  
  28. # ifndef LINT
  29.     extern QUEUE *alloc_queue ();
  30.     extern int en_queue ();
  31.     extern de_queue ();
  32. # else
  33.     extern QUEUE *alloc_queue (int);
  34.     extern int en_queue (QUEUE *, char);
  35.     extern int de_queue (QUEUE *);
  36. # endif
  37.